<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>RT-Thread RTOS: Kernel Object Management</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RT-Thread RTOS
   &#160;<span id="projectnumber">1.2.0</span>
   </div>
   <div id="projectbrief">An open source embedded real-time operating system</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___kernel_object.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Kernel Object Management<div class="ingroups"><a class="el" href="group___kernel.html">RT-Thread Kernel API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrt__object.html">rt_object</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrt__object__information.html">rt_object_information</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gadc83c17483bce09fad91cc8b2a3d0ed5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#gadc83c17483bce09fad91cc8b2a3d0ed5">RT_OBJECT_FLAG_MODULE</a>&#160;&#160;&#160;0x80</td></tr>
<tr class="separator:gadc83c17483bce09fad91cc8b2a3d0ed5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga40f88eaca0029aea304a7757c85431b8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga40f88eaca0029aea304a7757c85431b8">RT_OBJECT_HOOK_CALL</a>(func, argv)&#160;&#160;&#160;do { if ((func) != <a class="el" href="group___basic_def.html#gab3633bbb2a09b3406b19463ffc634345">RT_NULL</a>) func argv; } while (0)</td></tr>
<tr class="separator:ga40f88eaca0029aea304a7757c85431b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga91d74b4f1699da278153af455dadcd70"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structrt__object.html">rt_object</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a></td></tr>
<tr class="separator:ga91d74b4f1699da278153af455dadcd70"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga38a532bcb1bd3f12685db4219b761b56"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a> { <br/>
&#160;&#160;<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56a548d26bb698e083d38bd8f0649441a52">RT_Object_Class_Thread</a> = 0, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56a850c61dd598ead7fcf06baec83094c70">RT_Object_Class_Semaphore</a>, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56afd5b06c025abc6ebc90d0c3ce1e4f6fd">RT_Object_Class_Mutex</a>, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56ac379eb33745638b59cd9098f46fda7a6">RT_Object_Class_Event</a>, 
<br/>
&#160;&#160;<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56a72c12fbfbf3ff1080debc6ee3d4a900b">RT_Object_Class_MailBox</a>, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56a47535f15636cfef3f4d40cd2258e26fd">RT_Object_Class_MessageQueue</a>, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56a54439386d6e606a5596023616e28c096">RT_Object_Class_MemPool</a>, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56af875e996a48417b20a531df21c615f26">RT_Object_Class_Device</a>, 
<br/>
&#160;&#160;<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56a29bccdc3303ac04a7e25d40fea97ab12">RT_Object_Class_Timer</a>, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56a1e5b83d7de96e8d29324a710094f099b">RT_Object_Class_Module</a>, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56a7fd1d3fe31dd8000703a6198bd919c74">RT_Object_Class_Unknown</a>, 
<a class="el" href="group___kernel_object.html#gga38a532bcb1bd3f12685db4219b761b56ac3a51281d7f8fee902e6324673d39cec">RT_Object_Class_Static</a> = 0x80
<br/>
 }</td></tr>
<tr class="separator:ga38a532bcb1bd3f12685db4219b761b56"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga8cb85e5812b8e7c3705fb3c7702c992b"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structrt__object__information.html">rt_object_information</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga8cb85e5812b8e7c3705fb3c7702c992b">rt_object_get_information</a> (enum <a class="el" href="group___kernel_object.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a> type)</td></tr>
<tr class="separator:ga8cb85e5812b8e7c3705fb3c7702c992b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a86356c83e8264841fcb83255f72014"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga0a86356c83e8264841fcb83255f72014">rt_object_init</a> (struct <a class="el" href="structrt__object.html">rt_object</a> *object, enum <a class="el" href="group___kernel_object.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a> type, const char *name)</td></tr>
<tr class="separator:ga0a86356c83e8264841fcb83255f72014"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad3a5cf0c036738c6f0ee560a62bc93be"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#gad3a5cf0c036738c6f0ee560a62bc93be">rt_object_detach</a> (<a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a> object)</td></tr>
<tr class="separator:gad3a5cf0c036738c6f0ee560a62bc93be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga661bb999394a29404c20c7f3e58e5f64"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga661bb999394a29404c20c7f3e58e5f64">rt_object_allocate</a> (enum <a class="el" href="group___kernel_object.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a> type, const char *name)</td></tr>
<tr class="separator:ga661bb999394a29404c20c7f3e58e5f64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0479fb23b766d96e9611ed32becc2797"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga0479fb23b766d96e9611ed32becc2797">rt_object_delete</a> (<a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a> object)</td></tr>
<tr class="separator:ga0479fb23b766d96e9611ed32becc2797"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0b4471fdda93017477bc81ca357481ac"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___basic_def.html#ga3e03a3519ef7e33d13ebd34c482db49c">rt_bool_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga0b4471fdda93017477bc81ca357481ac">rt_object_is_systemobject</a> (<a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a> object)</td></tr>
<tr class="separator:ga0b4471fdda93017477bc81ca357481ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6c82dbb4ae114918c5c96d0dca3957eb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga6c82dbb4ae114918c5c96d0dca3957eb">rt_object_find</a> (const char *name, <a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a> type)</td></tr>
<tr class="separator:ga6c82dbb4ae114918c5c96d0dca3957eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0126bb4a5edd998ff952e1129e9e0cb9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga0126bb4a5edd998ff952e1129e9e0cb9">rt_system_object_init</a> (void)</td></tr>
<tr class="separator:ga0126bb4a5edd998ff952e1129e9e0cb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8bac83f313b9fb0215c424bec05174bd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga8bac83f313b9fb0215c424bec05174bd">rt_object_attach_sethook</a> (void(*hook)(struct <a class="el" href="structrt__object.html">rt_object</a> *object))</td></tr>
<tr class="separator:ga8bac83f313b9fb0215c424bec05174bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga28dd3af85707fc6c9bf548fe53460aca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga28dd3af85707fc6c9bf548fe53460aca">rt_object_detach_sethook</a> (void(*hook)(struct <a class="el" href="structrt__object.html">rt_object</a> *object))</td></tr>
<tr class="separator:ga28dd3af85707fc6c9bf548fe53460aca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabfce5c06de6e1cd6b661b05cb9dd6242"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#gabfce5c06de6e1cd6b661b05cb9dd6242">rt_object_trytake_sethook</a> (void(*hook)(struct <a class="el" href="structrt__object.html">rt_object</a> *object))</td></tr>
<tr class="separator:gabfce5c06de6e1cd6b661b05cb9dd6242"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga69054a027dcc8483b65fd48740eb3717"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#ga69054a027dcc8483b65fd48740eb3717">rt_object_take_sethook</a> (void(*hook)(struct <a class="el" href="structrt__object.html">rt_object</a> *object))</td></tr>
<tr class="separator:ga69054a027dcc8483b65fd48740eb3717"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad107a57fce56ef991d673fa21c6d065a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___kernel_object.html#gad107a57fce56ef991d673fa21c6d065a">rt_object_put_sethook</a> (void(*hook)(struct <a class="el" href="structrt__object.html">rt_object</a> *object))</td></tr>
<tr class="separator:gad107a57fce56ef991d673fa21c6d065a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The Kernel object system can access and manage all of the kernel objects.</p>
<p>Kernel objects include most of the facilities in the kernel:</p>
<ul>
<li>thread</li>
<li>semaphore and mutex</li>
<li>event/fast event, mailbox, messagequeue</li>
<li>memory pool</li>
<li>timer <div class="image">
<img src="Kernel_Object.png" alt="Kernel_Object.png"/>
<div class="caption">
Figure 2: Kernel Object</div></div>
 Kernel objects can be static objects, whose memory is allocated in compiling. It can be dynamic objects as well, whose memory is allocated from system heaps in runtime. </li>
</ul>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="gadc83c17483bce09fad91cc8b2a3d0ed5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_OBJECT_FLAG_MODULE&#160;&#160;&#160;0x80</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>is module object. </p>

</div>
</div>
<a class="anchor" id="ga40f88eaca0029aea304a7757c85431b8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RT_OBJECT_HOOK_CALL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">func, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">argv&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;do { if ((func) != <a class="el" href="group___basic_def.html#gab3633bbb2a09b3406b19463ffc634345">RT_NULL</a>) func argv; } while (0)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The hook function call macro </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga91d74b4f1699da278153af455dadcd70"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="structrt__object.html">rt_object</a>* <a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Type for kernel objects. </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga38a532bcb1bd3f12685db4219b761b56"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group___kernel_object.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The object type can be one of the follows with specific macros enabled:</p>
<ul>
<li>Thread</li>
<li>Semaphore</li>
<li>Mutex</li>
<li>Event</li>
<li>MailBox</li>
<li>MessageQueue</li>
<li>MemHeap</li>
<li>MemPool</li>
<li>Device</li>
<li>Timer</li>
<li>Module</li>
<li>Unknown</li>
<li>Static </li>
</ul>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56a548d26bb698e083d38bd8f0649441a52"></a>RT_Object_Class_Thread</em>&nbsp;</td><td class="fielddoc">
<p>The object is a thread. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56a850c61dd598ead7fcf06baec83094c70"></a>RT_Object_Class_Semaphore</em>&nbsp;</td><td class="fielddoc">
<p>The object is a semaphore. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56afd5b06c025abc6ebc90d0c3ce1e4f6fd"></a>RT_Object_Class_Mutex</em>&nbsp;</td><td class="fielddoc">
<p>The object is a mutex. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56ac379eb33745638b59cd9098f46fda7a6"></a>RT_Object_Class_Event</em>&nbsp;</td><td class="fielddoc">
<p>The object is a event. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56a72c12fbfbf3ff1080debc6ee3d4a900b"></a>RT_Object_Class_MailBox</em>&nbsp;</td><td class="fielddoc">
<p>The object is a mail box. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56a47535f15636cfef3f4d40cd2258e26fd"></a>RT_Object_Class_MessageQueue</em>&nbsp;</td><td class="fielddoc">
<p>The object is a message queue. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56a54439386d6e606a5596023616e28c096"></a>RT_Object_Class_MemPool</em>&nbsp;</td><td class="fielddoc">
<p>The object is a memory pool. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56af875e996a48417b20a531df21c615f26"></a>RT_Object_Class_Device</em>&nbsp;</td><td class="fielddoc">
<p>The object is a device </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56a29bccdc3303ac04a7e25d40fea97ab12"></a>RT_Object_Class_Timer</em>&nbsp;</td><td class="fielddoc">
<p>The object is a timer. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56a1e5b83d7de96e8d29324a710094f099b"></a>RT_Object_Class_Module</em>&nbsp;</td><td class="fielddoc">
<p>The object is a module. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56a7fd1d3fe31dd8000703a6198bd919c74"></a>RT_Object_Class_Unknown</em>&nbsp;</td><td class="fielddoc">
<p>The object is unknown. </p>
</td></tr>
<tr><td class="fieldname"><em><a class="anchor" id="gga38a532bcb1bd3f12685db4219b761b56ac3a51281d7f8fee902e6324673d39cec"></a>RT_Object_Class_Static</em>&nbsp;</td><td class="fielddoc">
<p>The object is a static object. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga8cb85e5812b8e7c3705fb3c7702c992b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structrt__object__information.html">rt_object_information</a> * rt_object_get_information </td>
          <td>(</td>
          <td class="paramtype">enum <a class="el" href="group___kernel_object.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a>&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will return the specified type of object information.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the type of object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the object type information or RT_NULL </dd></dl>

</div>
</div>
<a class="anchor" id="ga0a86356c83e8264841fcb83255f72014"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_object_init </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structrt__object.html">rt_object</a> *&#160;</td>
          <td class="paramname"><em>object</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="group___kernel_object.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize an object and add it to object system management.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">object</td><td>the specified object to be initialized. </td></tr>
    <tr><td class="paramname">type</td><td>the object type. </td></tr>
    <tr><td class="paramname">name</td><td>the object name. In system, the object's name must be unique. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gad3a5cf0c036738c6f0ee560a62bc93be"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_object_detach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a>&#160;</td>
          <td class="paramname"><em>object</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will detach a static object from object system, and the memory of static object is not freed.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">object</td><td>the specified object to be detached. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga661bb999394a29404c20c7f3e58e5f64"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a> rt_object_allocate </td>
          <td>(</td>
          <td class="paramtype">enum <a class="el" href="group___kernel_object.html#ga38a532bcb1bd3f12685db4219b761b56">rt_object_class_type</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will allocate an object from object system</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the type of object </td></tr>
    <tr><td class="paramname">name</td><td>the object name. In system, the object's name must be unique.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>object </dd></dl>

</div>
</div>
<a class="anchor" id="ga0479fb23b766d96e9611ed32becc2797"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_object_delete </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a>&#160;</td>
          <td class="paramname"><em>object</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will delete an object and release object memory.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">object</td><td>the specified object to be deleted. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0b4471fdda93017477bc81ca357481ac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___basic_def.html#ga3e03a3519ef7e33d13ebd34c482db49c">rt_bool_t</a> rt_object_is_systemobject </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a>&#160;</td>
          <td class="paramname"><em>object</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will judge the object is system object or not. Normally, the system object is a static object and the type of object set to RT_Object_Class_Static.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">object</td><td>the specified object to be judged.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RT_TRUE if a system object, RT_FALSE for others. </dd></dl>

</div>
</div>
<a class="anchor" id="ga6c82dbb4ae114918c5c96d0dca3957eb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___kernel_object.html#ga91d74b4f1699da278153af455dadcd70">rt_object_t</a> rt_object_find </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group___basic_def.html#ga585e2ad0fbab0f83817cb61373465df6">rt_uint8_t</a>&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will find specified name object from object container.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>the specified name of object. </td></tr>
    <tr><td class="paramname">type</td><td>the type of object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the found object or RT_NULL if there is no this object in object container.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>this function shall not be invoked in interrupt status. </dd></dl>

</div>
</div>
<a class="anchor" id="ga0126bb4a5edd998ff952e1129e9e0cb9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_system_object_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will initialize system object management.</p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>since 0.3.0, this function does not need to be invoked in the system initialization. </dd></dl>

</div>
</div>
<a class="anchor" id="ga8bac83f313b9fb0215c424bec05174bd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_object_attach_sethook </td>
          <td>(</td>
          <td class="paramtype">void(*)(struct <a class="el" href="structrt__object.html">rt_object</a> *object)&#160;</td>
          <td class="paramname"><em>hook</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will set a hook function, which will be invoked when object attaches to kernel object system.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hook</td><td>the hook function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga28dd3af85707fc6c9bf548fe53460aca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_object_detach_sethook </td>
          <td>(</td>
          <td class="paramtype">void(*)(struct <a class="el" href="structrt__object.html">rt_object</a> *object)&#160;</td>
          <td class="paramname"><em>hook</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will set a hook function, which will be invoked when object detaches from kernel object system.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hook</td><td>the hook function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gabfce5c06de6e1cd6b661b05cb9dd6242"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_object_trytake_sethook </td>
          <td>(</td>
          <td class="paramtype">void(*)(struct <a class="el" href="structrt__object.html">rt_object</a> *object)&#160;</td>
          <td class="paramname"><em>hook</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will set a hook function, which will be invoked when object is taken from kernel object system.</p>
<p>The object is taken means: semaphore - semaphore is taken by thread mutex - mutex is taken by thread event - event is received by thread mailbox - mail is received by thread message queue - message is received by thread</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hook</td><td>the hook function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga69054a027dcc8483b65fd48740eb3717"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_object_take_sethook </td>
          <td>(</td>
          <td class="paramtype">void(*)(struct <a class="el" href="structrt__object.html">rt_object</a> *object)&#160;</td>
          <td class="paramname"><em>hook</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will set a hook function, which will be invoked when object have been taken from kernel object system.</p>
<p>The object have been taken means: semaphore - semaphore have been taken by thread mutex - mutex have been taken by thread event - event have been received by thread mailbox - mail have been received by thread message queue - message have been received by thread timer - timer is started</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hook</td><td>the hook function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gad107a57fce56ef991d673fa21c6d065a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rt_object_put_sethook </td>
          <td>(</td>
          <td class="paramtype">void(*)(struct <a class="el" href="structrt__object.html">rt_object</a> *object)&#160;</td>
          <td class="paramname"><em>hook</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function will set a hook function, which will be invoked when object is put to kernel object system.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hook</td><td>the hook function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Jan 6 2014 23:05:02 for RT-Thread RTOS by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
  </ul>
</div>
</body>
</html>
